package com.nidu.demo.common.exception;

/**
 * 错误码常量
 */
public interface ErrorCodeConstants {

    ErrorCode SUCCESS = new ErrorCode("200", "成功");

    // ========== 客户端错误 ==========
    ErrorCode BAD_REQUEST = new ErrorCode("400", "请求参数不正确");
    ErrorCode UNAUTHORIZED = new ErrorCode("401", "账号未登录");
    ErrorCode FORBIDDEN = new ErrorCode("403", "没有该操作权限");
    ErrorCode NOT_FOUND = new ErrorCode("404", "请求未找到");
    ErrorCode METHOD_NOT_ALLOWED = new ErrorCode("405", "请求方法不正确");
    ErrorCode TIME_OUT = new ErrorCode("408", "请求超时");
    ErrorCode LOCKED = new ErrorCode("423", "请求失败，请稍后重试");
    ErrorCode TOO_MANY_REQUESTS = new ErrorCode("429", "请求过于频繁，请稍后重试");

    // ========== 服务端错误 ==========
    ErrorCode INTERNAL_SERVER_ERROR = new ErrorCode("500", "系统异常");
    ErrorCode NOT_IMPLEMENTED = new ErrorCode("501", "功能未实现/未开启");

    // ========== 认证相关 ==========
    ErrorCode TOKEN_EXPIRED = new ErrorCode("2001", "访问令牌已过期");
    ErrorCode TOKEN_INVALID = new ErrorCode("2002", "访问令牌无效，不存在或已过期");
    ErrorCode REFRESH_TOKEN_EXPIRED = new ErrorCode("2003", "刷新令牌已过期");
    ErrorCode REFRESH_TOKEN_INVALID = new ErrorCode("2004", "刷新令牌无效，不存在或已过期");
    ErrorCode PASSWORD_INVALID = new ErrorCode("2005", "密码错误");
    ErrorCode LOGIN_CAPTCHA_CODE_ERROR = new ErrorCode("2006", "验证码不正确");

    // ========== 租户相关 ==========
    ErrorCode TENANT_NOT_FOUND = new ErrorCode("3001", "租户不存在");
    ErrorCode TENANT_ID_NULL = new ErrorCode("3002", "租户ID不能为空");
    ErrorCode TENANT_DATA_FORBIDDEN = new ErrorCode("3003", "您没有访问该租户的数据权限");
    ErrorCode TENANT_STATUS_DISABLE = new ErrorCode("3004", "租户已被禁用");
    ErrorCode TENANT_NAME_DUPLICATE = new ErrorCode("3005", "租户名称重复");
    ErrorCode TENANT_EXPIRED = new ErrorCode("3006", "租户已过期，请续费");
    ErrorCode TENANT_ACCOUNT_COUNT_EXCEED = new ErrorCode("3006", "租户用户数量超过限制，请更换套餐");


    ErrorCode TENANT_PACKAGE_NOT_FOUND = new ErrorCode("3010", "租户套餐不存在");
    ErrorCode TENANT_PACKAGE_STATUS_DISABLE = new ErrorCode("3011", "租户套餐已被禁用");
    ErrorCode TENANT_PACKAGE_NAME_DUPLICATE = new ErrorCode("3005", "租户套餐名称重复");

    // ========== 用户相关 ==========
    ErrorCode USER_NOT_FOUND = new ErrorCode("3101", "用户不存在");
    ErrorCode USER_STATUS_DISABLE = new ErrorCode("3102", "用户已被禁用");

    ErrorCode USER_NAME_NOT_FOUND = new ErrorCode("3110", "用户名不存在") ;
    ErrorCode USER_NAME_DUPLICATE = new ErrorCode("3111", "用户名已经被使用，请更换用户名注册");
    ErrorCode USER_MOBILE_DUPLICATE = new ErrorCode("3112", "用户手机号已经被使用，请更换手机号注册");
    ErrorCode USER_EMAIL_DUPLICATE = new ErrorCode("3113", "用户邮箱已经被使用，请更换邮箱注册");

    ErrorCode USER_PASSWORD_CONFIRM_FAIL = new ErrorCode("3121", "两次输入的密码不一致，请重新输入");
    ErrorCode USER_PASSWORD_COMPARE_FAIL = new ErrorCode("3122", "用户输入的密码与系统中存储的密码不匹配");
    ErrorCode USER_PASSWORD_SAME_AS_OLD = new ErrorCode("3123", "用户输入的密码与系统中存储的密码相同");

    // ========== 公司相关 ==========
    ErrorCode COMPANY_NOT_FOUND = new ErrorCode("3201", "公司不存在");
    ErrorCode COMPANY_NAME_DUPLICATE = new ErrorCode("3202", "公司名称重复");
    ErrorCode COMPANY_HAS_USER = new ErrorCode("3204", "公司下存在用户，无法禁用");
    ErrorCode COMPANY_HAS_DEPARTMENT = new ErrorCode("3205", "公司下存在部门，无法禁用");
    ErrorCode COMPANY_STATUS_DISABLE = new ErrorCode("3206", "公司未启用，无法操作");

    // ========== 部门相关 ==========
    ErrorCode DEPARTMENT_NOT_FOUND = new ErrorCode("3301", "部门不存在");
    ErrorCode DEPARTMENT_CODE_DUPLICATE = new ErrorCode("3302", "部门编码重复");
    ErrorCode DEPARTMENT_HAS_USER = new ErrorCode("3303", "部门下存在用户，无法禁用");
    ErrorCode DEPARTMENT_HAS_CHILD = new ErrorCode("3304", "部门下存在子部门，无法禁用");
    ErrorCode DEPARTMENT_STATUS_DISABLE = new ErrorCode("3305", "部门未启用");
    ErrorCode DEPARTMENT_PARENT_NOT_FOUND = new ErrorCode("3306", "父部门不存在");
    ErrorCode DEPARTMENT_PARENT_STATUS_DISABLE = new ErrorCode("3307", "父部门未启用，无法操作子部门");

    // ========== 职位相关 ==========
    ErrorCode POSITION_NOT_FOUND = new ErrorCode("3401", "职位不存在");
    ErrorCode POSITION_CODE_DUPLICATE = new ErrorCode("3402", "职位编码重复");
    ErrorCode POSITION_HAS_USER = new ErrorCode("3403", "职位下存在用户");

    // ========== 角色相关 ==========
    ErrorCode ROLE_NOT_FOUND = new ErrorCode("3501", "角色不存在");
    ErrorCode ROLE_STATUS_DISABLE = new ErrorCode("3502", "角色已被禁用");
    ErrorCode ROLE_CODE_DUPLICATE = new ErrorCode("3503", "角色编码重复");
    ErrorCode ROLE_HAS_USER = new ErrorCode("3504", "角色下存在用户");

    // ========== 权限相关 ==========
    ErrorCode PERMISSION_NOT_FOUND = new ErrorCode("3601", "权限不存在");
    ErrorCode PERMISSION_CODE_DUPLICATE = new ErrorCode("3602", "权限编码重复");
    ErrorCode PERMISSION_HAS_ROLE = new ErrorCode("3603", "权限被角色使用");
    ErrorCode PERMISSION_HAS_CHILD = new ErrorCode("3604", "权限下存在子权限");

    // ========== 菜单相关 ==========
    ErrorCode MENU_NOT_FOUND = new ErrorCode("3701", "菜单不存在");
    ErrorCode MENU_PARENT_NOT_FOUND = new ErrorCode("3702", "父菜单不存在");
    ErrorCode MENU_STATUS_DISABLE = new ErrorCode("3703", "菜单已被禁用");
    ErrorCode MENU_NAME_DUPLICATE = new ErrorCode("3704", "菜单编码重复");
    ErrorCode MENU_HAS_ROLE = new ErrorCode("3705", "菜单被角色使用，无法禁用或删除菜单");
    ErrorCode MENU_HAS_CHILD = new ErrorCode("3706", "存在启用状态的子菜单，无法禁用或删除菜单");
    ErrorCode MENU_PARENT_STATUS_DISABLE = new ErrorCode("3707", "父菜单未启用，无法操作子菜单");

    // ========== 授权相关 ==========
    ErrorCode OAUTH2_ACCESS_TOKEN_NOT_FOUND = new ErrorCode("3801","oauth2访问令牌不存在");

    ErrorCode OAUTH2_REFRESH_TOKEN_NOT_FOUND = new ErrorCode("3811","oauth2刷新令牌不存在");
    ErrorCode OAUTH2_REFRESH_TOKEN_CLIENT_FAIL = new ErrorCode("3813", "oauth2刷新令牌和客户端不匹配");

    ErrorCode OAUTH2_CLIENT_NOT_FOUND = new ErrorCode("3821","oauth2客户端不存在");
    ErrorCode OAUTH2_CLIENT_STATUS_DISABLE = new ErrorCode("3822","oauth2客户端已被禁用");
    ErrorCode OAUTH2_CLIENT_DUPLICATE = new ErrorCode("3823", "oauth2客户端重复");
    ErrorCode OAUTH2_CLIENT_REDIRECT_URL_FAIL = new ErrorCode("3824","重定向地址与oauth2客户端重定向地址不匹配");
    ErrorCode OAUTH2_CLIENT_SECRET_FAIL = new ErrorCode("3825", "客户端密匙与oauth2客户端密匙不匹配");
    ErrorCode OAUTH2_CLIENT_SCOPE_NO_FOUND = new ErrorCode("3826", "客户端授权范围不存在oauth2客户端授权范围");

    ErrorCode OAUTH2_CODE_NOT_FOUND = new ErrorCode("3831","oauth2授权码不存在");
    ErrorCode OAUTH2_CODE_CLIENT_FAIL = new ErrorCode("3832","客户端与oauth2授权码客户端不匹配");
    ErrorCode OAUTH2_CODE_REDIRECT_URL_FAIL = new ErrorCode("3833","重定向地址与oauth2授权码重定向地址不匹配");

    ErrorCode OAUTH2_APPROVE_NOT_FOUND = new ErrorCode("3841","oauth2客户端没有通过授信");

    // ========== 字典相关 ==========
    ErrorCode DICT_TYPE_NOT_FOUND = new ErrorCode("3901", "字典类型不存在");
    ErrorCode DICT_TYPE_STATUS_DISABLE = new ErrorCode("3902","字典类型已被禁用");
    ErrorCode DICT_TYPE_TYPE_NOT_FOUND = new ErrorCode("3903", "字典类型不存在");
    ErrorCode DICT_TYPE_TYPE_DUPLICATE = new ErrorCode("3904", "字典类型已存在");

    ErrorCode DICT_DATA_NOT_FOUND = new ErrorCode("3901", "字典数据不存在");

    // ========== 配置相关 ==========
    ErrorCode CONFIG_NOT_FOUND = new ErrorCode("4001", "配置不存在");
    ErrorCode CONFIG_STATUS_DISABLE = new ErrorCode("4002", "配置已被禁用");
    ErrorCode CONFIG_KEY_DUPLICATE = new ErrorCode("4003", "配置键名重复");
    ErrorCode CONFIG_KEY_EMPTY = new ErrorCode("4004", "配置键名不能为空");

    // ========== 站内信消息相关 ==========
    ErrorCode NOTIFY_MESSAGE_NOT_FOUND = new ErrorCode("5001", "站内信消息不存在");
    ErrorCode NOTIFY_MESSAGE_IS_READ = new ErrorCode("5002", "站内信消息已标记已读");

    ErrorCode NOTIFY_TEMPLATE_NOT_FOUND = new ErrorCode("5011", "站内信消息模板不存在");
    ErrorCode NOTIFY_TEMPLATE_DISABLE = new ErrorCode("5012", "站内信消息模板已被禁用");
    ErrorCode NOTIFY_TEMPLATE_CODE_NOT_FOUND = new ErrorCode("5013", "站内信消息模板编码不存在");
    ErrorCode NOTIFY_TEMPLATE_CODE_DUPLICATE = new ErrorCode("5014", "站内信消息模板编码已存在");
    ErrorCode NOTIFY_TEMPLATE_PARAM_MISS = new ErrorCode("5015", "站内信消息模板参数不匹配存在");

    // ========== 通知公告相关 ==========
    ErrorCode NOTICE_NOT_FOUND = new ErrorCode("5101", "通知公告不存在");
    ErrorCode NOTICE_STATUS_DISABLE = new ErrorCode("5102", "通知公告已被禁用");

    // ========== Api接口日志相关 ==========
    ErrorCode API_ACCESS_LOG_NOT_FOUND = new ErrorCode("5201", "Api接口日志不存在");
    ErrorCode API_ACCESS_LOG_STATUS_DISABLE = new ErrorCode("5202", "Api接口日志已被禁用");

    // ========== 登录日志相关 ==========
    ErrorCode LOGIN_LOG_NOT_FOUND = new ErrorCode("5301", "登录日志不存在");
    ErrorCode LOGIN_LOG_STATUS_DISABLE = new ErrorCode("5302", "登录日志已被禁用");

    // ========== 操作日志相关 ==========
    ErrorCode OPERATE_LOG_NOT_FOUND = new ErrorCode("5401", "操作日志不存在");
    ErrorCode OPERATE_LOG_STATUS_DISABLE = new ErrorCode("5402", "操作日志已被禁用");

    // ========== 邮件账号相关 ==========
    ErrorCode MAIL_ACCOUNT_NOT_FOUND = new ErrorCode("5501", "邮件账号不存在");
    ErrorCode MAIL_ACCOUNT_STATUS_DISABLE = new ErrorCode("5502", "邮件账号已被禁用");

    // ========== 邮件模板相关 ==========
    ErrorCode MAIL_TEMPLATE_NOT_FOUND = new ErrorCode("5601", "邮件模板不存在");
    ErrorCode MAIL_TEMPLATE_STATUS_DISABLE = new ErrorCode("5602", "邮件模板已被禁用");
    ErrorCode MAIL_TEMPLATE_CODE_NOT_FOUND = new ErrorCode("5013", "邮件模板编码不存在");
    ErrorCode MAIL_TEMPLATE_CODE_DUPLICATE = new ErrorCode("5014", "邮件模板编码已存在");
    ErrorCode MAIL_TEMPLATE_PARAM_MISS = new ErrorCode("5015", "邮件模板参数不匹配存在");

    // ========== 邮件日志相关 ==========
    ErrorCode MAIL_LOG_NOT_FOUND = new ErrorCode("5701", "邮件日志不存在");
    ErrorCode MAIL_LOG_STATUS_DISABLE = new ErrorCode("5702", "邮件日志已被禁用");

    // ========== 文件相关 ==========
    ErrorCode FILE_NOT_FOUND = new ErrorCode("5801", "文件不存在");
    ErrorCode FILE_STATUS_DISABLE = new ErrorCode("5802", "文件已被禁用");

    // ========== 文件配置相关 ==========
    ErrorCode FILE_CONFIG_NOT_FOUND = new ErrorCode("5801", "文件配置不存在");
    ErrorCode FILE_CONFIG_TENANT_NOT_FOUND = new ErrorCode("5802", "该租户下没有找到任何文件配置");
    ErrorCode FILE_CONFIG_STATUS_DISABLE = new ErrorCode("5802", "文件配置已被禁用");

    // ========== 国际化相关 ==========
    ErrorCode I18N_LOCATE_PARSE_FAIL = new ErrorCode("5901", "国际化解析语言失败, 格式不对");
    ErrorCode I18N_CODE_NOT_FOUND = new ErrorCode("5902", "国际化不支持该语言");
}